package com.itheima.system.Exception;

public class BusinessException extends RuntimeException {
    //自定义异常中封装对应的错误编码，用于异常处理时获取对应的操作编码
    //继承RuntimeException，快捷出所有的构造方法，添加一个code的成员方法并快捷出get和set方法，
    //把code的set方法的调用语句和形式参数添加到每个构造方法内的形参位置

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }




    public BusinessException(Integer code) {
        this.code = code;
    }

    public BusinessException(String message,Integer code) {

        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause,Integer code) {

        super(message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause,Integer code) {

        super(cause);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace,Integer code) {

        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }



}
